<template>
  <div class="demo-container">
      <pull-list :onInfinite="onInfinite" :enableInfinite='isEnd' ref="pullList" >
        <ul>
          <li v-for="item in num" :key="item">{{item}}</li>
        </ul>
      </pull-list>
    </div>
</template>

<script>
import pullList from "../components/pull-list"
export default {
  components:{
    'pull-list':pullList
  },
  data() {
    return {
      num:100,
      isEnd:false
    }
  },
  methods: {
    onInfinite(done){
     setTimeout(()=>{
       done()
       this.num+=40
       if(this.num>400){
         this.isEnd=true
       }
     },3000)
    },
    scrollTo(){
      this.$refs.pullList.scrollTo()
    }
  },
}
</script>

<style scoped >
li{
  list-style: none;
}
</style>